<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script src = "../js/jquery-1.12.1.js" type = "text/javascript"></script>
	<script src = "../js/common.js" type = "text/javascript"></script>
	<title>登录</title>
	<link href="<%=request.getContextPath() %>/css/login.css" rel="stylesheet" type="text/css" />
 	<style type="text/css">
	a:link {color: #0000FF;text-decoration:none}     /* 未被访问的链接 红色 没有下划线*/
	a:hover {color: #00FFFF;text-decoration:none}    
	a:visited {color: #00FF00;text-decoration:none}  /* 已被访问过的链接 绿色 没有下划线*/
	#Pwd{
		width:140px;
		height:20px;
		border:none;
		border: #0a8ccc 1px solid;
	}
	</style>
<script type="text/javascript"> 

	if (top.location !== self.location) {
	    top.location=self.location;
	}
	function getOs(){   
	     var OsObject = "";   
	     if(navigator.userAgent.indexOf("MSIE")>0) {   
	          return "MSIE";   
	     }   
	     if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){   
	          return "Firefox";   
	     }
	  }

 	
 </script>
 </head>
 
<body>
	<form  id="loginInfo" action="login?ActionType=login_Init" method="post" >
 	<div class="Degl">
  		<div class="contn">
 		 <li>
  		 	<span>用户名</span>
    		<input name="logId" type="text" id="User"  onblur="inputOnBlur()" />
  		</li>
 		 <li>
  			<span>密&nbsp; 码</span>
    		<input name="password" type="password" id="Pwd"  />
  		</li>
		  <li>
			    <input type="submit" name="login" id="login" value=""  />
			    <input type="reset" name="reset" id="reset" value="" />
		  </li>
  </div>
<div class="copyright"> Copyright© 2015 Wang Yangting</div>
</div>
</form>

<script type="text/javascript"><!--
	function loginClick(){
		var username=document.getElementById("User").value;
		//var courseId = $("#courseId").val();
		//var classId = $("#classId").val();
		var Pwd = $("#Pwd").val();
		if(username==null || username=="" || username==''){
			alert("请填写用户名！");
			return false;
		}
		/* else if(courseId==null || courseId=="" || courseId==''){
			 alert("请选择课程！");
			 return false;
		}
		else  if( classId ==null ||  classId =="" ||  classId ==''){
			 alert("请选择班级！");
			 return false;
		} */
		 else{
			return true;
		}
	}
	
	
	
	function inputOnBlur() {
		var username=document.getElementById("User").value;
		if(username==null || username=="" || username==''){
			alert("请填写用户名！");
		}
	    
	} 
	
	
	 /*  function courseChange() {
		//如果课程下拉列表的值改变则调用此方法
		var courseId = $("#courseId").val();
		var username=document.getElementById("User").value;
		if(username==null || username=="" || username==''){
			 alert("请先输入用户名！");
		}
	};*/
	
	
	
	/* function login_click() {
		//如果课程下拉列表的值改变则调用此方法
		var courseId = $("#courseId").val();
		var classId = $("#classId").val();
		var username=document.getElementById("User").value;
		var password=document.getElementById("Pwd").value;
		if(username==null || username=="" || username==''){
			 alert("请先输入用户名！");
		}else if(courseId==null || courseId=="" || courseId==''){
			 alert("请选择课程！");
		}else if(classId==null || classId=="" || classId==''){
			 alert("请选择班级！");
		}else if(password==null || password=="" || password==''){
			 alert("请输入密码！");
		}else{
			$.ajax({
	        	type : "post",
	        	dataType:"json",
	        	url : "login?ActionType=login_Init",
	        	data : {"TEACHER_ID":username,"COURSE_ID":courseId},
	        	success : function(message) {
	        		$("#classId").empty();
	        		var firstId = "";
	        		var firstOption="请选择班级";
	        		$("#classId").prepend("<option value='"+firstId+"' >"+firstOption+"</option>"); 
	        		var topicList = message;
	        		console.log(message);
	        		$.each(topicList, function(i,topic) {
	        		    $("#classId").append("<option value='"+topic.course_class_id+"' >"+topic.course_class_name+"</option>");
	        		});
	       	 	}
	    	});
		}
	}; */
	





</script>
</body>
</html>

